//
//  MMCollectionView.m
//  EraPig
//
//  Created by Mac_Mini on 2021/3/11.
//

#import "MMCollectionView.h"

@implementation MMCollectionView

/// 初始化CollectionView
/// @param frame frame
/// @param layout layout
/// @param dataSource 数据源
/// @param delegate 代理
- (instancetype)initWithFrame:(CGRect)frame
         collectionViewLayout:(UICollectionViewLayout *)layout
                   dataSource:(id)dataSource
                     delegate:(id)delegate{
    if (self = [super initWithFrame:frame collectionViewLayout:layout]) {
       self.dataSource = dataSource;
       self.delegate = delegate;
       [self config];
   }
   return self;
}
- (void)config{
    self.showsVerticalScrollIndicator = NO;
    self.showsHorizontalScrollIndicator = NO;
    self.backgroundColor = [UIColor clearColor];
    
    if (@available(iOS 11.0, *)) {
        self.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
    } else {
        // Fallback on earlier versions
    }
}
@end
